package com.easidea.tim.entity.purchase;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.springside.core.dao.extend.Undeletable;

import com.easidea.tim.entity.BaseEntity;
@Entity(name="tim_purchase_order_item")
@org.hibernate.annotations.Entity(dynamicInsert=true,dynamicUpdate=true)
@Undeletable(status="deleted")
@Cache(region="tim_purchase_order_item",usage=CacheConcurrencyStrategy.READ_WRITE)
public class PurchaseOrderItem extends BaseEntity {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	//产品id
	private long productId;
	//品名
	private String productName;
	//单价
	private Double productPurchasePrice;
	//色号
	private String productColorCode;
	//水准
	private String productStandardCode;
	//预约到货日期
	private Date productArrivalDate;
	//备注
	private String memo;
	//
	private Double totalArrival;
	//采购合同编号
	private PurchaseOrder purchaseOrder;
	
	@Column(name="product_id", nullable=false)
	public long getProductId() {
		return productId;
	}
	public void setProductId(long productId) {
		this.productId = productId;
	}
	@Column(name="product_name", nullable=false)
	public String getProductName() {
		return productName;
	}
	public void setProductName(String productName) {
		this.productName = productName;
	}
	@Column(name="product_purchase_price", nullable=false)
	public Double getProductPurchasePrice() {
		return productPurchasePrice;
	}
	
	public void setProductPurchasePrice(Double productPurchasePrice) {
		this.productPurchasePrice = productPurchasePrice;
	}
	@Column(name="product_color_code", nullable=false)
	public String getProductColorCode() {
		return productColorCode;
	}
	public void setProductColorCode(String productColorCode) {
		this.productColorCode = productColorCode;
	}
	@Column(name="product_standard_code")
	public String getProductStandardCode() {
		return productStandardCode;
	}
	public void setProductStandardCode(String productStandardCode) {
		this.productStandardCode = productStandardCode;
	}
	@Column(name="product_arrival_date", nullable=false)
	public Date getProductArrivalDate() {
		return productArrivalDate;
	}
	public void setProductArrivalDate(Date productArrivalDate) {
		this.productArrivalDate = productArrivalDate;
	}


	@Column(name="memo")
	public String getMemo() {
		return memo;
	}
	
	public void setMemo(String memo) {
		this.memo = memo;
	}
	@Column(name="total_arrival", nullable=false)
	public Double getTotalArrival() {
		return totalArrival;
	}
	public void setTotalArrival(Double totalArrival) {
		this.totalArrival = totalArrival;
	}
	@ManyToOne(cascade=CascadeType.MERGE)
	@JoinColumn(name="purchase_order_id",nullable=false)
	public PurchaseOrder getPurchaseOrder() {
		return purchaseOrder;
	}
	public void setPurchaseOrder(PurchaseOrder purchaseOrder) {
		this.purchaseOrder = purchaseOrder;
	}

}
